package com.kaishengit.web;


import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.kaiashengit.service.GuideService;
import com.kaisengit.enity.Guide;

public class GuideServlet extends HttpServlet {

	
	private static final long serialVersionUID = 1L;
	
	@Override
	protected void service(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
			
		GuideService guideService = new GuideService();
		
		String name = request.getParameter("name");
		System.out.println("hi" + name);
		Guide guide = guideService.findByname(name);
		
		response.setContentType("text/html");
		PrintWriter out = response.getWriter();
		if(guide == null){
			
			out.print("ok");
			
			
		}else{
			out.print("no");
		}
		
		out.flush();
		out.close();
	}

}
